﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using wt.wine.Domain.Entities;

namespace wt.wine.Application.ManageOrderTable
{
    public class GetOrderTableListDTO
    {
        public List<GetOrderTableModelDTO> Items { get; }
        public int PageIndex { get; }
        public int TotalPages { get; }
        /// <summary>
        /// 总数据
        /// </summary>
        public int TotalCount { get; }
        /// <summary>
        /// 总容量
        /// </summary>
        public int CapacityCount { get; set; }
        public GetOrderTableListDTO(List<GetOrderTableModelDTO> items, int count,int capacityCount, int pageIndex, int pageSize)
        {
            PageIndex = pageIndex;
            TotalPages = (int)Math.Ceiling(count / (double)pageSize);
            TotalCount = count;
            Items = items;
            CapacityCount = capacityCount;
        }
        public bool HasPreviousPage => PageIndex > 1;

        public bool HasNextPage => PageIndex < TotalPages;
    }


    public class GetOrderTableModelDTO
    {
        public int id { get; set; }
        /// <summary>
        /// 会员名
        /// </summary>
        public string membername { get; set; }
        /// <summary>
        /// 订单编号
        /// </summary>
        public string orderno { get; set; }
        /// <summary>
        /// 订单量
        /// </summary>
        public int ordercapacity { get; set; }
        /// <summary>
        /// 实际出酒量
        /// </summary>
        public int currentcapacity { get; set; }
        /// <summary>
        /// 自定义设备id
        /// </summary>
        public string cusdeviceid { get; set; }
        /// <summary>
        ///             0-已下单，1-订单完成，2-取消订单  3、异常订单 
        ///   文本对应： 0： 已下单待出酒 1  订单完成 出酒完成 3、异常订单
        /// /// </summary>
        public int state { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 订单价格
        /// </summary>
        public int price { get; set; }
        public string Createtime { get; set; }
    }
}
